﻿<navigation:Page xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
  x:Class="RIAServicesLegacyDalIntegration.Home" 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
  mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"  
  Style="{StaticResource PageStyle}" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:my="clr-namespace:RIAServicesLegacyDalIntegration.Web.Services" xmlns:my1="clr-namespace:RIAModels">

  <Grid x:Name="LayoutRoot">
    <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}" >

      <StackPanel x:Name="ContentStackPanel" Style="{StaticResource ContentStackPanelStyle}" DataContext="{Binding}">
                <riaControls:DomainDataSource LoadSize="20" AutoLoad="True" d:DesignData="{d:DesignInstance my1:RIAUser, CreateList=true}" Height="0" LoadedData="rIAUserDomainDataSource_LoadedData_1" Name="rIAUserDomainDataSource" QueryName="GetUserQuery" Width="0">
                    <riaControls:DomainDataSource.DomainContext>
                        <my:GetDataContext />
                    </riaControls:DomainDataSource.DomainContext>
                    <riaControls:DomainDataSource.QueryParameters>
                        <riaControls:Parameter ParameterName="name" Value="{Binding ElementName=nameTextBox, Path=Text}" />
                        <riaControls:Parameter ParameterName="randomUserStatusCode" Value="{Binding ElementName=randomUserStatusCodeTextBox, Path=Text}" />
                    </riaControls:DomainDataSource.QueryParameters>
                </riaControls:DomainDataSource>
                <StackPanel Height="30" Orientation="Horizontal">
                    <sdk:Label Content="Name:" Margin="3" VerticalAlignment="Center" />
                    <TextBox Name="nameTextBox" Width="60" />
                    <Grid DataContext="{Binding ElementName=rIAUserDomainDataSource, Path=Data}" HorizontalAlignment="Left" Name="grid1" VerticalAlignment="Top">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                    </Grid>
                    <sdk:Label Content="Random User Status Code:" Margin="3" />
                    <TextBox Name="randomUserStatusCodeTextBox" Width="60" />
                    <Button Command="{Binding Path=LoadCommand, ElementName=rIAUserDomainDataSource}" Content="Load" Margin="3" Name="rIAUserDomainDataSourceLoadButton" Click="rIAUserDomainDataSourceLoadButton_Click" />
                </StackPanel>
                <sdk:DataGrid AutoGenerateColumns="False" Height="289" ItemsSource="{Binding ElementName=rIAUserDomainDataSource, Path=Data}" Name="rIAUserDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" Width="562">
                    <sdk:DataGrid.Columns>
                        <sdk:DataGridTextColumn x:Name="riaFirstNameColumn" Binding="{Binding Path=RiaFirstName}" Header="Ria First Name" Width="SizeToHeader" />
                        <sdk:DataGridTextColumn x:Name="riaUserNameColumn" Binding="{Binding Path=RiaUserName, Mode=OneWay}" Header="Ria User Name" IsReadOnly="True" Width="SizeToHeader" />
                    </sdk:DataGrid.Columns>
                </sdk:DataGrid>
                <sdk:DataPager Height="26" IsTotalItemCountFixed="True" Source="{Binding Data, ElementName=rIAUserDomainDataSource}" Name="dataPager1" PageSize="10" Width="560" />
            </StackPanel>

    </ScrollViewer>
  </Grid>

</navigation:Page>